﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ordering
{
    public class OrderBoardOM
    {
        //public static IList<string> getFriends(string staffId)
        //{
        //    return OrderBoardDao.getFriends(staffId);
        //}

        public static IList<IDictionary<string, string>> getTeams()
        {
            return OrderBoardDao.ListTeams();
        }

        public static IList<IDictionary<string, string>> getOrders(GroupType type, string staffId)
        {
            return OrderBoardDao.ListOrders(type, staffId);
        }

        public static IList<Team> ListTeams()
        {
            return OrderBoardDao.ListTeams2();
        }

        #region FriendOM

        public static bool isFriend(string staffId, string friendId)
        {
            return OrderBoardDao.isFriend(staffId, friendId);
        }

        public static int addOrRemoveFriend(string staffId, string friendId)
        {
            if (OrderBoardDao.isFriend(staffId, friendId))
            {
                OrderBoardDao.removeFriend(staffId, friendId);
                return (int)IsFriend.No;
            }
            else
            {
                OrderBoardDao.AddFriend(staffId, friendId);
                return (int)IsFriend.Yes;
            }
        }

        #endregion
    }
}
